<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<meta name="format-detection" content="email=no">
		<meta charset="UTF-8">
		<link rel="stylesheet" href="css/mui.min.css">
		<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
		<link href="css/mystrap.css" rel="stylesheet" type="text/css" />

		<title>地图</title>

		<style type="text/css">
			body,
			html,
			#allmap {
				width: 100%;
				height: 100%;
				overflow: hidden;
				margin: 0;
				font-family: "微软雅黑";
			}
		</style>
		<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=RCrePW5EKH7aEUN7qrbVxyngo2xq7Oaw&s=1"></script>

		<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
	</head>

	<body style="background: #F9F7EC;">

		<div id="allmap"></div>
		<div class="mui-inner-wrap">

			<header id="header" class="mui-bar mui-bar-nav" style="background: #F9F7EC;">
				<a href="index.html#offCanvasSide" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" style="color:#000000"></a>
				<h1 class="mui-title">大慧宗杲足迹</h1>
			</header>

		</div>
		<script src="js/mui.min.js"></script>
		<script type="text/javascript">
			// 百度地图API功能	
			var sContent =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>宁国慧云寺</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dh_hys.jpg' width='139' height='104' title='宁国慧云寺'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>大慧17岁慧云寺出家</p>" +
				"</div>";
			var sContent1 =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>宣州景德寺</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dh_jds.jpg' width='139' height='104' title='宣州景德寺'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>大慧17岁，九月纳僧服，十月请具足戒于景德寺</p>" +
				"</div>";
			var s2 =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>太平州隐静杯渡庵</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dh_yjs.gif' width='139' height='104' title='太平州隐静杯渡庵'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>大慧19岁，师初至太平州游隐静杯渡，庵主僧迎待甚厚，且顾伽蓝神而言曰：昨宵将三鼓，梦此人告以“今日云峰悦禅师来，且戒其为待耳</p>" +
				"</div>";

			var s3 =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>江西南昌泐潭山宝峰寺</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dj_bfs.jpg' width='139' height='104' title='江西南昌泐潭山宝峰寺'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>21岁，江西南昌泐潭山宝峰寺挂搭,投临济宗黄龙派湛堂文准（1061-1115真净克文的弟子）参学6年</p>" +
				"<p>湛堂去世前嘱咐大慧 去克勤圆悟禅师处参学</p>"
			"</div>";
			var s4 =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>扬州天宁寺</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dj_bfs.jpg' width='139' height='104' title='扬州天宁寺'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>师三十九岁。居杨州天宁。</p>" +

				"</div>";

			var s5 =
				"<h4 style='margin:0 0 5px 0;padding:0.2em 0'>镇江金山寺</h4>" +
				"<img style='float:right;margin:4px' id='imgDemo' src='images/dj_bfs.jpg' width='139' height='104' title='扬州天宁寺'/>" +
				"<p style='margin:0;line-height:1.5;font-size:13px;text-indent:2em'>十月同琳普明渡江，省侍圆悟于金山（镇江金山寺）。</p>" +

				"</div>";
			map = new BMap.Map("allmap");
			map.centerAndZoom(new BMap.Point(116.460217,30.807313), 7);
			map.addControl(new BMap.MapTypeControl()); //添加地图类型控件
			map.setCurrentCity("成都"); // 设置地图显示的城市 此项是必须设置的
			map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
			map.enableDragging();
			var top_left_control = new BMap.ScaleControl({
				anchor: BMAP_ANCHOR_BOTTOM_RIGHT
			}); // 左上角，添加比例尺
			
			
			map.addControl(top_left_control);
			//map.addControl(top_left_navigation);
			//map.addControl(top_right_navigation);
			/*缩放控件type有四种类型:
			BMAP_NAVIGATION_CONTROL_SMALL：仅包含平移和缩放按钮；BMAP_NAVIGATION_CONTROL_PAN:仅包含平移按钮；BMAP_NAVIGATION_CONTROL_ZOOM：仅包含缩放按钮*/

			// 添加带有定位的导航控件
			var navigationControl = new BMap.NavigationControl({
				// 靠左上角位置
				anchor: BMAP_ANCHOR_BOTTOM_RIGHT,
				// LARGE类型
				type: BMAP_NAVIGATION_CONTROL_LARGE,
				// 启用显示定位
				enableGeolocation: true
			});
			map.addControl(navigationControl);
			// 添加定位控件
			var geolocationControl = new BMap.GeolocationControl();
			geolocationControl.addEventListener("locationSuccess", function(e) {
				// 定位成功事件
				var address = '';
				address += e.addressComponent.province;
				address += e.addressComponent.city;
				address += e.addressComponent.district;
				address += e.addressComponent.street;
				address += e.addressComponent.streetNumber;
				//alert("当前定位地址为：" + address);
			});
			geolocationControl.addEventListener("locationError", function(e) {
				// 定位失败事件
				alert(e.message);
			});
			map.addControl(geolocationControl);
			map.enableScrollWheelZoom(true);

			map.enableDragging(); //两秒后开启拖拽
			
			
			
			var data_info = [
				[118.983593, 30.639176,"宣州宁国县：1089年大慧禅师出生"],
				[119.168111, 30.541833, sContent],
				[118.767002, 30.956627, sContent1],
				[118.287873, 31.047829, s2],
				[112.596367, 31.175727, "19岁，是年秋，游庐阜（庐山）而至郢州"],
				[116.001261, 29.561078, "19岁，是年秋，游庐阜（庐山）而至郢州"],
				[115.416664, 29.00765, s3],
				[114.885742, 25.814152, "师三十岁。参潜庵源禅师于豫章之章江 "],
				[114.252101, 29.030467, "师三十一岁。依兜率照禅师席下(江西南昌修水县龙安山兜率寺"],
				[114.303556, 34.808395, "师三十四岁。初至京师(河南开封)，师三十五岁。居太宰庵。"],
				[113.945989, 34.379098, "师三十六岁。九月克勤圆悟有天宁寺之命诏，师三十七岁。四月抵天宁寺挂搭"],
				[119.444362, 32.406495, s4],
				[119.422539, 32.226615, s5],
				[120.545562,31.368689,"师三十九岁，偕隆藏主之吴门少憩宝华，次虎丘,师四十岁。居虎丘"],
				[118.87472,32.06319,"师四十岁，十月省觐 克勤圆悟于云居(江西云居山真如禅寺) 道由金陵（南京）访韩子苍待制，留五宿而别"]<
				[115.594443,29.097585,"师四十，去云居山（克勤住持江西云居山真如禅寺）"],
				[115.82074,29.03738,"师四十二岁。是年春，迁海昏云门庵(江西永修县云门禅寺)"],
				[114.35273,27.628174,"师四十三岁。登仰山邂逅东林圭禅师,(仰山栖隐寺位于江西省宜春市城南23公里的明月山集云峰)"],
				[119.530541,25.953075,"绍兴四年三月,宗杲至福建长乐,住广田寺、洋屿,五年正月迁莆中灵岩天宫庵,（师49岁）再移福建泉州小溪云门庵"],
				[119.771422,30.386012,"师四十九（1138），杭州径山寺,师七十岁。正月初十日被旨迁住径山"],
				[112.582421,26.901579,"师五十四岁。居衡州(湖南衡阳)，廖季绎通直之西园"],
				[116.113881,24.296685,"师六十二岁 命移梅州，取道郴阳 ，师六十八岁。正月二十一日离梅阳"],
				[116.353293,25.846038,"师六十八岁，取道汀州二月至赣川"],
			[121.770584,29.847117,"师六十九岁。住育王（宁波古阿育王寺）"],
			[120.10804,30.246793,"　师七十岁。正月初十日被旨迁住径山。二月二十八日。就灵隐寺"],
			[118.721839,30.969254,"师七十二岁,冬行化宛陵"],
			[118.868376,32.056343,"师七十二岁,冬行化宛陵，次当途抵建邺留守尚书韩公仲通率僚属请说法于保宁寺。长老昙华请为众普说于钟山"],
			[119.444565,32.407279,"师七十三岁。正月舟次仪真太守徐公敦立请说法于天宁寺（扬州）"],
			[119.768935,30.386941,"师七十五岁，隆兴元年八月十日大慧禅师示寂于径山明月堂。"]
			];

			var opts = {
				width: 300, // 信息窗口宽度
				height: 200, // 信息窗口高度
				title: "介绍", // 信息窗口标题
				enableMessage: true //设置允许信息窗发送短息
			};
			for(var i = 0; i < data_info.length; i++) {
				var marker = new BMap.Marker(new BMap.Point(data_info[i][0], data_info[i][1])); // 创建标注
				var content = data_info[i][2];
				map.addOverlay(marker); // 将标注添加到地图中
				var j=i+1;
				/*var polyline = new BMap.Polyline([new BMap.Point(data_info[j][0], data_info[j][1]), 
				new BMap.Point(data_info[j+1][0],data_info[j+1][1]) ], {strokeColor:"red",//设置颜色
            strokeWeight:3, //宽度
            strokeOpacity:0.5});//透明度
            map.addOverlay(polyline);*/
				addClickHandler(content, marker);
				
			}
            /*alert(data_info[2][0]);
            alert(data_info[3][0]);*/
            
			function addClickHandler(content, marker) {
				marker.addEventListener("click", function(e) {
					openInfo(content, e)
				});
			}

			function openInfo(content, e) {
				var p = e.target;
				var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
				var infoWindow = new BMap.InfoWindow(content, opts); // 创建信息窗口对象 
				map.openInfoWindow(infoWindow, point); //开启信息窗口
			}
		</script>

	</body>

</html>